import React, { Component } from 'react';
import './Contact.scss'
import axios from 'axios'

class Contact extends Component {
    constructor(props) {
        super(props)
        this.state = {
            list: []
        }
    }
    componentDidMount() {
        axios.get('http://api.aulence.com/store-manage/w2001/store_manager_info.php').then(res => {
            console.log(res.data);
            this.setState({
                list: res.data
            })
        })
    }
    render() {

        // const { brand, goodsName, model, category, intoDatetime, quantity,price} = this.state
        return (
            <div className="Contact">
                <header>
                    <div>联系管理员</div>
                </header>
                <main>
                    {/* <div className="Contact-name">姜子牙</div>
                         <div className="Contact-details">
                             <div>职位:</div>
                             <div>仓库主管</div>
                         </div>
                         <div className="Contact-details">
                             <div>管理地区:</div>
                             <div>四川-成都</div>
                         </div>
                         <div className="Contact-details">
                             <div>手机号:</div>
                             <div>13048432459</div>
                         </div> */}
                    {
                        this.state.list.map((item) => {
                            return (
                                <div key={item.adminID}>
                                    <div className="Contact-name">
                                        <div>{item.adminName}</div>
                                    </div>
                                    <div className="Contact-details">
                                        <div>职位:</div>
                                        <div>{item.positions}</div>
                                    </div>
                                    <div className="Contact-details">
                                        <div>管理地区:</div>
                                        <div>{item.province}-{item.city}</div>
                                    </div>
                                    <div className="Contact-details">
                                        <div>手机号:</div>
                                        <div>{item.tel}</div>
                                    </div>
                                </div>
                            )
                        })
                    }
                </main>
            </div>
        );
    }
}

export default Contact;